package com.mingmen.supplier.httpconfig;

import com.mingmen.supplier.http.MyOkhttp;
import com.mingmen.supplier.http.callback.StringCallback;

public class HttpResponse {

    public static void getCode(String phone, String t, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.getCode)
                .params("phone", phone)
                .params("t", t)
                .execute(callback);

    }

    public static void getRegister(String phone, String pwd, String verifyCode, String SupplierName, String linkman, String tel, String categoryId, String markId,
                                   String address, String idPositive, String idReverse, String businessLicense, String circulationPermit, String foodPermit,
                                   StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.REGISTER)
                .params("phone", phone)
                .params("pwd", pwd)
                .params("verifyCode", verifyCode)
                .params("SupplierName", SupplierName)
                .params("linkman", linkman)
                .params("tel", tel)
                .params("categoryId", categoryId)
                .params("markId", markId)
                .params("address", address)
                .params("idPositive", idPositive)
                .params("idReverse", idReverse)
                .params("businessLicense", businessLicense)
                .params("circulationPermit", circulationPermit)
                .params("foodPermit", foodPermit)
                .execute(callback);

    }

    //【获取供应商类型】{action} = listSupplierCategory
    public static void listSupplierCategory(StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTSUPPLIERCATEGORY)
                .execute(callback);

    }

    //【获取市场列表】{action} = listMarket
    public static void listMarket(StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTMARKET)
                .execute(callback);
    }


    public static void getLogin(String phone, String pwd, String t, String companyId, String appType, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LOGIN)
                .params("phone", phone)
                .params("pwd", pwd)
                .params("t", t)
                .params("companyId", companyId)
                .params("appType", appType)
                .execute(callback);

    }

    public static void Forget(String token, String phone, String verifyCode, String originalPassword, String newPassword, String t, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.FORGET)
                .params("token", token)
                .params("phone", phone)
                .params("verifyCode", verifyCode)
                .params("originalPassword", originalPassword)
                .params("newPassword", newPassword)
                .params("t", t)
                .execute(callback);

    }

    //【获取市场列表】{action} = listMarket
    public static void createCommodity(String token, String commodityName, String picture, String description, String spec, String categoryId,String specAccuracy, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.CREATECOMMODITY)
                .params("token", token)
                .params("commodityName", commodityName)
                .params("picture", picture)
                .params("description", description)
                .params("spec", spec)
                .params("categoryId", categoryId)
                .params("specAccuracy", specAccuracy)
                .execute(callback);
    }



    public static void daiShenhe(String token, String st, String startTime, String endTime, String flag, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.DAISHENHE)
                .params("token", token)
                .params("st", st)
                .params("startTime", startTime)
                .params("endTime", endTime)
                .params("flag", flag)

                .execute(callback);
    }


    public static void getSupplierCommodity(String token, String categoryId, String state, String keyword,int pageNumber, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETSUPPLIERCOMMODITY)
                .params("token", token)
                .params("categoryId", categoryId)
                .params("state", state)
                .params("keyword", keyword)
                .params("pageNumber", pageNumber)
                .execute(callback);

    }

    public static void getCommodityDetail(String token, String commodityId, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETCOMMODITYDETAIL)
                .params("token", token)
                .params("commodityId", commodityId)


                .execute(callback);

    }

    public static void getCategoryList(String token, String categoryId, String flag, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETCATEGORYLIST)
                .params("token", token)
                .params("categoryId", categoryId)
                .params("flag", flag)

                .execute(callback);

    }

    //【规格列表（与用户相关）】 {action} = getSpecByUser
    public static void getSpecByUser(String token, String count, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETSPECBYSUER)
                .params("token", token)
                .params("count", count)


                .execute(callback);

    }

    //5.3.2.11【发布公告】 {action} = addAnnouncement
    public static void addAnnouncement(String token, String title, String picture, String content, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.ADDANNOUNCEMENT)
                .params("token", token)
                .params("title", title)
                .params("picture", picture)
                .params("content", content)

                .execute(callback);

    }

    //【获取本单位公告】 {action} = listAnnouncement
    public static void listAnnouncement(String token, String keyword, String startTime, String endTime,int pageNumber, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTANNOUNCEMENT)
                .params("token", token)
                .params("keyword", keyword)
                .params("startTime", startTime)
                .params("endTime", endTime)
                .params("pageNumber", pageNumber)
                .execute(callback);

    }

    //【获取本单位公告】 {action} = listAnnouncement
    public static void getAnnouncement(String token, String announceId, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETANNOUNCEMENT)
                .params("token", token)
                .params("announceId", announceId)


                .execute(callback);
    }

    //【商品价格、库存维护】 {action} = setPrice
    public static void setPrice(String token, String updateDate, String categoryId, String jdata, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.SETPRICE)
                .params("token", token)
                .params("updateDate", updateDate)
                .params("categoryId", categoryId)
                .params("jdata", jdata)
                .execute(callback);
    }

    //【商品价格、库存维护】 {action} = setPrice
    public static void getAllCommodity(String token, String categoryId, String keyword,int pageNumber, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETALLCOMMODITY)
                .params("token", token)
                .params("categoryId", categoryId)
                .params("keyword", keyword)
                .params("pageNumber", pageNumber)
                .execute(callback);
    }

    //【批量从大库增加到本单位】 {action} = setCommodityFromLibrary
    public static void setCommodityFromLibrary(String token, String jdata, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.SETCOMMODITYFROMLIBRARY)
                .params("token", token)
                .params("jdata", jdata)

                .execute(callback);
    }

    //【商品下架】 {action} = stopSupplierCommodity
    public static void removeSupplierCommodity(String token, String commodityIds, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.STOPSUPPLIERCOMMODITY)
                .params("token", token)
                .params("commodityIds", commodityIds)

                .execute(callback);
    }

    //【获取每日商品维护列表】 {action} = listCommodityByDate
    public static void listCommodityByDate(String token, String startDate, String keyword, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTCOMMODITYBYDATE)
                .params("token", token)
                .params("startDate", startDate)
                .params("keyword", keyword)

                .execute(callback);
    }

    //【获取市场列表】{action} = listMarket
    public static void listMarket(String region, String markets, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTMARKET_LIST)
                .params("region", region)
                .params("markets", markets)

                .execute(callback);
    }



    //【商品下架】 {action} = stopSupplierCommodity
    public static void stopSupplierCommodity(String token, String commodityIds, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.SUPPLIERCOMMODITYSTOP)
                .params("token", token)
                .params("commodityIds", commodityIds)

                .execute(callback);
    }

    //【获取供应商基本信息】 {action} = getSupplier
    public static void getSupplier(String token, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETSUPPLIER)
                .params("token", token)
                .execute(callback);
    }

    //【保存供应商基本信息】 {action} = setSupplier
    public static void setSupplier(String token, String supplierName, String linkman, String tel, String categoryId, String marketId, String address,
                                   String idPositive, String idReverse, String businessLicense, String circulationPermit, String foodPermit, String category,
                                   String market,

                                   StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.SETSUPPLIER)
                .params("token", token)
                .params("supplierName", supplierName)
                .params("linkman", linkman)
                .params("tel", tel)
                .params("categoryId", categoryId)
                .params("marketId", marketId)
                .params("address", address)
                .params("idPositive", idPositive)
                .params("idReverse", idReverse)
                .params("businessLicense", businessLicense)
                .params("circulationPermit", circulationPermit)
                .params("foodPermit", foodPermit)
                .params("category", category)
                .params("market", market)
                .execute(callback);
    }


    //【获取供应商基本信息】 {action} = getSupplier
    public static void listOrder(String token, String st, String keyword, String startTime, String endTime,int pageNumber, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTORDER)
                .params("token", token)
                .params("st", st)
                .params("keyword", keyword)
                .params("startTime", startTime)
                .params("endTime", endTime)
                .params("pageNumber", pageNumber)
                .execute(callback);
    }

    //【获取订单详细信息】 {action} = getOrder
    public static void getOrder(String token, String billId, String partCancelFlag, String partArriveFlag, String partRefuseFlag, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETORDER)
                .params("token", token)
                .params("billId", billId)
                .params("partCancelFlag", partCancelFlag)
                .params("partArriveFlag", partArriveFlag)
                .params("partRefuseFlag", partRefuseFlag)
                .execute(callback);
    }

    //【获取订单详细信息】 {action} = getOrder
    public static void getCommodityBatch(String token,String commodityIds, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETCOMMODITYBATCH)
                .params("token", token)
                .params("commodityIds", commodityIds)

                .execute(callback);
    }

    //【接单/发货时价格、数量修改】 {action} = receivingOrder
    public static void receivingOrder(String token, String billId, String shipping, String shippingFee, String jdata, String flag, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.RECEIVINGORDER)
                .params("token", token)
                .params("billId", billId)
                .params("shipping", shipping)
                .params("shippingFee", shippingFee)
                .params("jdata", jdata)
                .params("flag", flag)
                .execute(callback);
    }


    //【拒绝】 {action} = rejectOrder
    public static void rejectOrder(String token, String billId, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.REJECTORDER)
                .params("token", token)
                .params("billId", billId)
                .execute(callback);
    }


    //【拒绝】 {action} = rejectOrder
    public static void listSupplierByKeyword(String token, String keyword, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTSUPPLIERKEYWORD)
                .params("token", token)
                .params("keyword", keyword)
                .execute(callback);
    }


    //【合作餐厅列表】 {action} = listRestaurant
    public static void listRestaurant(String token, String keyword, String st, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.LISTRESTAURANT)
                .params("token", token)
                .params("keyword", keyword)
                .params("st", st)
                .execute(callback);
    }

    //【合作历史记录】 {action} = getCooperationLog
    public static void getCooperationLog(String token, String restaurantId,int pageNumber, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETCOOPERATIONLOG)
                .params("token", token)
                .params("restaurantId", restaurantId)
                .params("pageNumber", pageNumber)
                .execute(callback);
    }

    //【每日订单汇总】 {action} = sumOrderDaily
    public static void sumOrderDaily(String token, String sumDate, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.SUMORDERDAILY)
                .params("token", token)
                .params("sumDate", sumDate)

                .execute(callback);
    }

    //【取消订单详情查看】 {action} = getCancelOrder
    public static void getCancelOrder(String token, String billId, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.GETCANCELORDER)
                .params("token", token)
                .params("billId", billId)

                .execute(callback);
    }

    //【取消订单详情查看】 {action} = getCancelOrder
    public static void setShopCloseOrOpen(String token, StringCallback callback) {
//        CompanyId 没有传0
        MyOkhttp.post(AppConfig.Url + AppConfig.SETSHOPCLOSEOROPEN)
                .params("token", token)

                .execute(callback);
    }


    //    【获取分类下商品】
    public static void getFenLeiShop(String token, String categoryId, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.SHOPFENLEI_LIST)
                .params("token", token)
                .params("categoryId", categoryId)

                .execute(callback);
    }


    //追加订单
    public static void getItem(String token, String applyId, String commodityId, String amount, String role, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.DELETE_ITEM)
                .params("token", token)
                .params("applyId", applyId)
                .params("commodityId", commodityId)
                .params("amount", amount)
                .params("role", role)
                .execute(callback);
    }

    //    NEW_PRICE 参照历史申请单生成新申请单
    public static void addNewPrice(String token, String applyId, String arrivalDate, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.NEW_PRICE)
                .params("token", token)
                .params("applyId", applyId)
                .params("arrivalDate", arrivalDate)

                .execute(callback);
    }

    //    【根据申请单显示商品清单】
    public static void showShopDetail(String token, String applyId, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.SHOW_SHOPDETAIL)
                .params("token", token)
                .params("applyId", applyId)

                .execute(callback);
    }

    //【获取被驳回的申请单数量】
    public static void getBohuiCount(String token, String startTime, String endTime, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.GETCOUNT)
                .params("token", token)
                .params("startTime", startTime)
                .params("endTime", endTime)
                .execute(callback);
    }

    //    为商品添加备注
    public static void getRemark(String token, String commodityId, String mark, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.REMARK)
                .params("token", token)
                .params("commodityId", commodityId)
                .params("mark", mark)
                .execute(callback);
    }

    //    修改商品数量
    public static void getModify(String token, String applyId, String role, String modiData, String deleteData, StringCallback callback) {
        MyOkhttp.post(AppConfig.Url + AppConfig.NEWMODIFY_NUMBER)
                .params("token", token)
                .params("applyId", applyId)
                .params("role", role)
                .params("modiData", modiData)
                .params("deleteData", deleteData)
                .execute(callback);
    }

    //    商品提交
    public static void submitData(String token, String limitDate, String flag, String jdata, String timeSpan, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.ADDAPPLYBILL)
                .params("token", token)
                .params("limitDate", limitDate)
                .params("flag", flag)
                .params("jdata", jdata)
                .params("timeSpan", timeSpan)
                .execute(callback);

    }

    //    采购单按状态列表
    public static void getConsumeBillList(String token, String st, String startTime, String endTime, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.CONSUMEBILLLIST)
                .params("token", token)
                .params("st", st)
                .params("startTime", startTime)
                .params("endTime", endTime)

                .execute(callback);

    }

    //    驳回商品列表
    public static void getBohuiList(String token, String applyId, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.BOHUILIST)
                .params("token", token)
                .params("applyId", applyId)
                .execute(callback);

    }

    //    获取仓库列表

    public static void getCangKuList(String token, String flag, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.CANGKULIST)
                .params("token", token)
                .params("flag", flag)
                .execute(callback);

    }

    // 【领取出库】
    public static void getChukuSubmit(String token, String applyId, String jdata, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.CHUKUSUBMIT)
                .params("token", token)
                .params("applyId", applyId)
                .params("jdata", jdata)

                .execute(callback);

    }

    // 【商品比价】
    public static void getComparePrice(String token, String startTime, String endTime, String commodityId, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.COMPARE_PRICE)
                .params("token", token)
                .params("startTime", startTime)
                .params("endTime", endTime)
                .params("commodityId", commodityId)
                .execute(callback);

    }

    // 【获取所有商品列表】
    public static void getComparePriceList(String token, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.GETALL_SHOPLIST)
                .params("token", token)

                .execute(callback);

    }

    // 【申请单审批】
    public static void getApplyListByOrder(String token, String st, String startTime, String endTime, String flag, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.GETAPPLYLIST)
                .params("token", token)
                .params("st", st)
                .params("startTime", startTime)
                .params("endTime", endTime)

                .execute(callback);

    }

    // 【申请单审批】
    public static void getApplyListByCategory(String token, String st, String startTime, String endTime, String keyWord, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.GETAPPLYBYCATEGORY)
                .params("token", token)
                .params("st", st)
                .params("startTime", startTime)
                .params("endTime", endTime)
                .params("keyWord", keyWord)
                .execute(callback);

    }

    public static void setAuditCancel(String token, String flag, String id, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.AUDITCANCEL)
                .params("token", token)
                .params("flag", flag)
                .params("id", id)

                .execute(callback);

    }

    public static void setAuditReject(String token, String jdata, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.AuditReject)
                .params("token", token)
                .params("jdata", jdata)


                .execute(callback);

    }

    public static void setAuditRejectPass(String token, String applyId, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.AuditReject)
                .params("token", token)
                .params("applyId", applyId)


                .execute(callback);

    }

    public static void setHeartBeat(String token, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.HEARTBEAT)
                .params("token", token)

                .execute(callback);

    }

    public static void setLock(String token, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.LOCK)
                .params("token", token)

                .execute(callback);

    }

    public static void setUnLock(String token, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.UNLOCK)
                .params("token", token)

                .execute(callback);

    }

    public static void setAuditPass(String token, String applyId, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.AUDITPASS)
                .params("token", token)
                .params("applyId", applyId)
                .execute(callback);

    }

    public static void getPrePurchaseDate(String token, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.PREPURCHASE)
                .params("token", token)

                .execute(callback);

    }

    public static void getPrePurchaseCount(String token, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.PRECHASECOUNT)
                .params("token", token)

                .execute(callback);

    }

    public static void setCommodityCollect(String token, String commodityId, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.COMMODITYQUICK)
                .params("token", token)
                .params("commodityId", commodityId)
                .execute(callback);

    }

    //备注标签
    public static void getMark(String token, String count, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.GETMARK)
                .params("token", token)
                .params("count", count)
                .execute(callback);
    }

    //按供货商获取购物车中待采购商品
    public static void getShoppingCart(String token, String startTime, String endTime, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.SHOPPINGCART)
                .params("token", token)
                .params("startTime", startTime)
                .params("endTime", endTime)
                .execute(callback);
    }

    //新增送货地址
    public static void addAddress(String token, String address, String flag, String linkman, String linkTel, String houseNumber, String supplierId, String gender, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.ADDADDRESS)
                .params("token", token)
                .params("address", address)
                .params("flag", flag)
                .params("linkman", linkman)
                .params("linkTel", linkTel)
                .params("houseNumber", houseNumber)
                .params("supplierId", supplierId)
                .params("gender", gender)
                .execute(callback);
    }
    //【供应商端订单生成图片】{action} = supplierOrderImage
    public static void supplierOrderImage(String token, String billId, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.SUPPLIERORDERIMAGE)
                .params("token", token)

                .params("billId", billId)
                .execute(callback);
    }
    // 【发货】 {action} = deliverGoods
    public static void deliverGoods(String token, String billId,String shipping,String shippingFee,String jdata,String flag, StringCallback callback) {

        MyOkhttp.post(AppConfig.Url + AppConfig.DELIVERGOODS)
                .params("token", token)
                .params("billId", billId)
                .params("shipping", shipping)
                .params("shippingFee", shippingFee)
                .params("jdata", jdata)
                .params("flag", flag)
                .execute(callback);
    }
}
